package com.bwie.controller.api;


import com.bwie.api.common.SimpleRandomLottery;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

@RestController
@Slf4j
public class TestCommonModule implements SimpleRandomLottery {

    @Override
    public String draw(String userName) {
        Random random = new Random();
        int i = random.nextInt(5);
        log.info("用户{}抽中{}等奖",userName,i);
        return userName+ "抽中了"+i+"等奖!" ;
    }
}
